package com.fsnbigdata.util;

import com.querydsl.core.types.Expression;
import com.querydsl.core.types.Order;
import com.querydsl.core.types.OrderSpecifier;
import com.querydsl.core.types.dsl.PathBuilder;
import org.springframework.data.domain.Sort;

/**
 * 排序工具类
 */
public class SortTools  {

    /**
     * 根据字段进行排序
     * @param orderType
     * @param orderField
     * @return
     */
    public static Sort basicSort(String orderType, String orderField) {
        Sort sort = new Sort(Sort.Direction.fromString(orderType), orderField);
        return sort;
    }
}
